#define  _CRT_SECURE_NO_WARNINGS 1

#include "string.h"

void TestString1()
{
	zzh::string s1;
	cout << s1.c_str() << endl;
	zzh::string s2("hello world");

	cout << s2.c_str() << endl;

	for (size_t i = 0; i < s2.size(); ++i)
	{
		s2[i] += 2;
		cout << s2[i] << ' ';
	}
	cout << endl;
	cout << s2.c_str() << endl;

	for (auto ch : s2)
	{
		cout << ch << " ";
	}
	cout << endl;

	for (auto& ch : s2)
	{
		ch -= 2;
		cout << ch << " ";
	}
	cout << endl;

	zzh::string s3("hello");
	cout << s3.size() << endl;
	cout << s3.capacity() << endl;
	s3 += 'x';
	cout << s3.c_str() << endl;
	s3 += "xxxxxxxxxxx";
	cout << s3.c_str() << endl;


}

int main()
{
	TestString1();

	return 0;
}